﻿#pragma once

#include"stdafx.h"
#include<string>
using namespace std;

struct DB_Struct
{
	char name[128]; //128
	bool type;            //1个字节
	char filename[256];
	CTime  crtime; //8个字节
	friend bool operator==(DB_Struct one,DB_Struct two) {
			return !strcmp(one.name,two.name);
	}
}; 

struct Table_Tb
{
	char name[128]; //128
	int record_num; //4
	int fileld_num; //4
	char tdf[256]; //
	char tic[256];
	char trd[256];
	char tid[256];
	CTime  crtime; //8
    CTime  mtime; //8
};

struct Table_Tdf
{
	int order;
	char name[128];
	char type[1];
	int param ;
	CTime  mtime;
	char intergrities[5][2];
	bool index;
};

struct Table_Tic
{
	char name[128];
	char field[128];
	int type;
	char param[256];
};

struct Table_Tid
{
	char name[128];
	bool  unique;
	bool asc;
	int field_num;
	char fields[2][128];
	char record_file[256];
	char index_file[256];
};

struct insert_model
{

	string  key;
	string value;
	string type;
	int pos;
	int mmSize;
	char intergrities[5][2];
	bool index;
};
struct Table_Index {
	char key[256];
	unsigned int pos;
};

struct struct_where
{
	string key;
	string value;
	string operater;//><=
	string type;
	string joiner;
	int pos;
	int size;
	bool index;
};